﻿#include <QStringList>
#include <QFile>
#include <QDate>
#include <QTextCodec>
#include <QMessageBox>

#include "common.h"
#include "storematter.h"

using namespace std;
static QTextStream cout(stdout);

StoreMatter::StoreMatter()
{

}

/*
QStringList StoreMatter::ReadFile()
{
    QStringList strList;
    QString fileName = QDate::currentDate().toString("yyyy.MM.dd");
    cout << fileName <<endl;
    QFile file(fileName);

    //如果文件不存在则创建文件，否则打开文件
    if (!file.exists()) {
        if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
            qDebug() << file.errorString();
            return QStringList();
        }
    }else {
        cout << "File is exist"<<endl;
        if (!file.open(QIODevice::ReadOnly |  QIODevice::Text)) {
            qDebug() << file.errorString();
            return QStringList();
        }
    }

    QTextStream in(&file);
    while (!in.atEnd()) {
        strList.append(in.readLine());
    }


    file.close();

    return strList;
}

bool StoreMatter::WriteFile(int index,const QStringList& strList)
{
    return true;
}
*/
